function ret = calDist(xpt1,ypt1,zpt1,xpt2,ypt2,zpt2)
  sum_length = 0;
  for i = 1:length(xpt1)
      sum_length = sum_length+sqrt((xpt1(i)-xpt2(i))^2+...
          (ypt1(i)-ypt2(i))^2+...
      (zpt1(i)-zpt2(i))^2);
  end
  ret = sum_length/length(xpt1);
end